-- Actor test cases
-- This is a simple tick-tock scenario

chatty is package{
  import actors;
  
  type talker is alias of actor of {ear has type stream of string};
  
  chatty has type (()=>talker)=>talker;
  chatty(Who) is actor{
    private var lifeTime := 100; 
    on Msg on ear do{
      logMsg(info,"I hear #Msg");
      if lifeTime>0 then {
        lifeTime := lifeTime-1;
        notify Who() with "Did you hear[#Msg]?" on ear;
      }
    };
  };
  
  main() do
    let{
      ping is memo chatty(pong);
      pong is memo chatty(ping);
    } in {notify ping() with "hello" on ear};
}
  
  